<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<style type="text/css">
body{
	padding:0px;
	margin:0px;
}
table{
	width:99%;
	margin-top: 8px;
	border: 1px solid #cccccc;
}
table th,td{
	font-size: 14px;
	border: 1px solid #cccccc;
	font-family: serif;
	text-align :left;
	width:24%;
}
</style>
</head>
<body>
<div id="produce_div" style="min-height:500px;">
	<#if (orders?size > 0)>
	<#list orders as order>
		<table cellpadding="0" cellspacing="0">
		<tr style="background-color:#aaeeff;">
			<td colspan="2">
				订单编号 :${order.orderNo}
			</td>
			<td colspan="2">
				产品名称 :${order.product.productName?html}
			</td>
		</tr>
		<tr>
			<td>
				计划投产时间:
				${order.planBeginDate?string("yyyy-MM-dd HH:mm:ss")}
			</td>
			<td>
				计划结束时间:${order.planEndDate?string("yyyy-MM-dd HH:mm:ss")}
			
			</td>
			<td colspan="2">
				计划投产数量:${order.planNumber}
			</td>
		</tr>
		<tr>
			<td colspan="1">
				实际投产时间:11
			</td>
			<td colspan="3">
				生产负责人:
				<a href="javascript: userinfo(${order.product.produceUser.id});">${order.product.produceUser.name?html}</a>
			</td>
		</tr>
		<tr>
			<td>
				<dl>
					<dt>状态:${OrderController.obtainStatusStr(order.status)}</dt>
					<#if order.status == Orderinfo.STATUS_PRODUCE>
					<dd>
						<input type="button" value="领取生产原料" onclick="javascript: parent.location.href='${basepath}/collar/create.htm?productId=${order.product.id}';" />
					</dd>
					<dd>
						<input type="button" value="生产己完成退料" onclick="javascript: parent.location.href='${basepath}/produce/finishproduce.htm?orderId=${order.id}';" />
					</dd>
					</#if>
					<#if order.status == Orderinfo.STATUS_FINISH>
					<dd>
						<input type="button" value="检测入库" onclick="javascript: checkinlibrary(${order.product.id});"/>
					</dd>
					</#if>
					<#--未实现,simple>
					<dd>
						<input type="button" value="取消生产" />
					</dd>
					<-->
				<dl>
			</td>
			<td colspan="3">
				<dl>
					<dt>领料记录:</dt>
					<#if order.product.materiallogs??>
					<#list order.product.materiallogs as materiallog>
						<dd>
							${materiallog.desc?html}
						</dd>
					</#list>
						<dd>...<a href="javascript: self.location.href='${basepath}/materiallog/list.htm?productId=${order.product.id}';">more</a></dd>
					<#else>
						<dd></dd>
					</#if>
				</dl>
			</td>
		</tr>
		</table>	
	</#list>
	<#else>
		当前没有生产中的产品信息
	</#if>
</div>
</body>
<script type="text/javascript" src="${basepath}/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="${basepath}/js/common_szy.js"></script>
<script type="text/javascript" src="${basepath}/js/lhgdialog/lhgdialog.min.js"></script>
<script type="text/javascript">
(function(){
	window.parent.document.getElementById("resultpage").height=document.getElementById("produce_div").clientHeight+20;
})();
<#--检测入库-->
function checkinlibrary(productId){
	getpostform("${basepath}/produce/checkinlibrary.htm","post","_parent",{"_method":"put","productId":productId});
};
<#--用户信息-->
function userinfo(userId){
	$.get("${basepath}/user/info/json.htm",{"userId":userId},function(data){
		var sex = (data.sex == 0 ? "女":"男");
		var html = "<ul style='list-style-type: none;'>";
		html += "<li>用户名:"+data.name+"</li>";
			html += "<li>性别:"+sex+"</li>";
			html += "<li>电子邮件:"+data.email+"</li>";
			html += "<li>联系电话:"+data.phone+"</li>";
			html += "</ul>";
			
		$.dialog({
		title : "用户信息",
		content: html,
		max : false,
		min : false,
		resize : false,
		ok : function(){
			return true;
		},
		cancelVal : '关闭',
		cancel : true
	});
	});
};
</script>
</html>